1 /* 2 3 Boost Software License - Version 1.0 - August 17th, 2003 4 5 Permission is hereby granted, free of charge, to any person or organization 6 obtaining a copy of the software and accompanying documentation covered by 7 this license (the "Software") to use, reproduce, display, distribute, 8 execute, and transmit the Software, and to prepare derivative works of the 9 Software, and to permit third-parties to whom the Software is furnished to 10 do so, all subject to the following: 11 12 The copyright notices in the Software and this entire statement, including 13 the above license grant, this restriction and the following disclaimer, 14 must be included in all copies of the Software, in whole or in part, and 15 all derivative works of the Software, unless such copies or derivative 16 works are solely in the form of machine-executable object code generated by 17 a source language processor. 18 19 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT 22 SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE 23 FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, 24 ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 25 DEALINGS IN THE SOFTWARE. 26 27 */ 28 29 module derelict.purple.eventloop; 30 31 import derelict.glib.gtypes; 32 import derelict.glib.glibconfig; 33 import derelict.glib.gmain; 34 35 extern (C): 36 37 alias _Anonymous_0 PurpleInputCondition; 38 alias void function (void*, int, _Anonymous_0) PurpleInputFunction; 39 alias _PurpleEventLoopUiOps PurpleEventLoopUiOps; 40 41 enum _Anonymous_0 42 { 43 PURPLE_INPUT_READ = 1, 44 PURPLE_INPUT_WRITE = 2 45 } 46 47 struct _PurpleEventLoopUiOps 48 { 49 guint function (guint, GSourceFunc, gpointer) timeout_add; 50 gboolean function (guint) timeout_remove; 51 guint function (int, PurpleInputCondition, PurpleInputFunction, gpointer) input_add; 52 gboolean function (guint) input_remove; 53 int function (int, int*) input_get_error; 54 guint function (guint, GSourceFunc, gpointer) timeout_add_seconds; 55 void function () _purple_reserved2; 56 void function () _purple_reserved3; 57 void function () _purple_reserved4; 58 } 59 60 61 version(Derelict_Link_Static) 62 { 63 extern( C ) nothrow 64 { 65 guint purple_timeout_add(guint interval, GSourceFunc function_, gpointer data); 66 guint purple_timeout_add_seconds(guint interval, GSourceFunc function_, gpointer data); 67 gboolean purple_timeout_remove(guint handle); 68 guint purple_input_add(int fd, PurpleInputCondition cond, PurpleInputFunction func, gpointer user_data); 69 gboolean purple_input_remove(guint handle); 70 int purple_input_get_error(int fd, int* error); 71 void purple_eventloop_set_ui_ops(PurpleEventLoopUiOps* ops); 72 PurpleEventLoopUiOps* purple_eventloop_get_ui_ops(); 73 } 74 } 75 else 76 { 77 extern( C ) nothrow 78 { 79 alias da_purple_timeout_add = guint function(guint interval, GSourceFunc function_, gpointer data); 80 alias da_purple_timeout_add_seconds = guint function(guint interval, GSourceFunc function_, gpointer data); 81 alias da_purple_timeout_remove = gboolean function(guint handle); 82 alias da_purple_input_add = guint function(int fd, PurpleInputCondition cond, PurpleInputFunction func, gpointer user_data); 83 alias da_purple_input_remove = gboolean function(guint handle); 84 alias da_purple_input_get_error = int function(int fd, int* error); 85 alias da_purple_eventloop_set_ui_ops = void function(PurpleEventLoopUiOps* ops); 86 alias da_purple_eventloop_get_ui_ops = PurpleEventLoopUiOps* function(); 87 } 88 89 __gshared 90 { 91 da_purple_timeout_add purple_timeout_add; 92 da_purple_timeout_add_seconds purple_timeout_add_seconds; 93 da_purple_timeout_remove purple_timeout_remove; 94 da_purple_input_add purple_input_add; 95 da_purple_input_remove purple_input_remove; 96 da_purple_input_get_error purple_input_get_error; 97 da_purple_eventloop_set_ui_ops purple_eventloop_set_ui_ops; 98 da_purple_eventloop_get_ui_ops purple_eventloop_get_ui_ops; 99 } 100 }